Quiz: Goroutines and Interfaces
Test your understanding of goroutines and interfaces in Go.
14
What is the output of the following code?
package main
import (
"fmt"
"io"
)
func main() {
var w io.Writer
r := w.(io.Reader)
fmt.Println(r == nil)
}
Your Answer
A)It will execute successfully.
Correct Answer
B)It will panic.
C)
It will be stuck in an infinite loop.
D)
None of the above.
Question 14 of 1414 attempted
Solution: Goroutines
Inheritance